#include <stdio.h>
#include <ctype.h>
int main() {
    char c;
    int letter = 0, space = 0, digit = 0, other = 0;
    printf("输入一行字符：\n");
    while ((c = getchar()) != '\n') {
        if (isalpha(c)) {
            letter++;
        } else if (isspace(c)) {
            space++;
        } else if (isdigit(c)) {
            digit++;
        } else {
            other++;
        }
    }
    printf("字母个数：%d\n空格个数:%d\n数字个数:%d\n其他字符个数:%d\n", letter, space, digit, other);
    return 0;
}